package com.ruoyi.common.enums;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: sunye
 * @date: 2024/10/24
 * @description: 公用业务枚举类
 */
public enum CommonBusiEnum {

    //**************** 适用终端 begin *****************/
    APPLY_TERMINAL_WEB(1, "WEB端"),
    APPLY_TERMINAL_GZH(2, "公众号"),
    APPLY_TERMINAL_XCX(3, "小程序"),
    APPLY_TERMINAL_DLDP(4, "导览大屏"),
    APPLY_TERMINAL_ZHGL(5, "后台综合管理端");
    //**************** 适用终端 end *****************/

    private int code;
    private String name;

    CommonBusiEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    /**
     * 根据编码获取适用终端类型
     *
     * @param code
     * @return
     */
    public static CommonBusiEnum getApplyTerminalByCode(int code) {
        for (CommonBusiEnum terminal : values()) {
            if (terminal.getCode() == code) {
                return terminal;
            }
        }
        return null;
    }



}
